package com.heiye.count.api.api;

import com.heiye.count.api.constants.ApiConstants;
import com.heiye.count.api.dto.*;
import com.heiye.framework.common.response.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author: heiye
 * @date: 2025/05/15 上午9:38
 * @version: v1.0.0
 * @description: 计数服务 Feign 接口
 */
@FeignClient(name = ApiConstants.SERVICE_NAME)
public interface CountFeignApi {

    String PREFIX = "/count";

    /**
     * 查询用户维度计数
     *
     * @param findUserCountsByIdReqDTO
     * @return
     */
    @PostMapping(value = PREFIX + "/user/data")
    Response<FindUserCountsByIdRspDTO> findUserCount(@RequestBody FindUserCountsByIdReqDTO findUserCountsByIdReqDTO);

    /**
     * 批量查询问题计数
     *
     * @param findQuizCountsByIdsReqDTO
     * @return
     */
    @PostMapping(value = PREFIX + "/quizzes/data")
    Response<List<FindQuizCountsByIdRspDTO>> findQuizzesData(@RequestBody FindQuizCountsByIdsReqDTO findQuizCountsByIdsReqDTO);

    /**
     * 查询问题计数
     *
     * @param findQuizCountsByIdReqDTO
     * @return
     */
    @PostMapping(value = PREFIX + "/quiz/data")
    Response<FindQuizCountsByIdRspDTO> findQuizCountData(@Validated @RequestBody FindQuizCountsByIdReqDTO findQuizCountsByIdReqDTO);

    /**
     * 更新问题评论计数
     *
     * @param updateQuizCommentCountReqDTO
     * @return
     */
    @PostMapping(value = PREFIX + "/quiz/comment/count")
    Response<?> updateQuizCommentCountData(@RequestBody UpdateQuizCommentCountReqDTO updateQuizCommentCountReqDTO);

    /**
     * 批量查询评论计数
     *
     * @param findCommentCountByIdsReqDTO
     * @return
     */
    @PostMapping(value = PREFIX + "/comments/data")
    Response<List<FindCommentCountByIdRspDTO>> findCommentsCountData(@Validated @RequestBody FindCommentCountByIdsReqDTO findCommentCountByIdsReqDTO);
}
